<div class="questions view">
<h2><?php echo $question['Question']['text']; ?></h2>
	<dl>
	<dt><?php echo ('Módulo'); ?></dt>
		<dd>
			<?php echo $this->Html->link($question['Topic']['title'], array('controller' => 'topics', 'action' => 'view', $question['Topic']['id'])); ?>
			&nbsp;
		</dd>
	</dl>

<div class="related">
	<h3><?php __('Alternativas');?></h3>
	<?php if (!empty($question['Choice'])):?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php __(''); ?></th>
		<th><?php __('¿Correcta?'); ?></th>
		<th class="actions"><?php __('');?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($question['Choice'] as $choice):
			$class = null;
			if ($i++ % 2 == 0) {
				$class = ' class="altrow"';
			}
		?>
		<tr<?php echo $class;?>>
			<td><?php echo $this->Html->link($choice['text'], array('controller' => 'choices', 'action' => 'view', $choice['id'])); ?>
		</td>


			<td><?php if($choice['isCorrect']==1) echo 'Si';?><?php if($choice['isCorrect']==0) echo 'No';?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('Editar', true), array('controller' => 'choices', 'action' => 'edit', $choice['id'])); ?>
				<?php echo $this->Html->link(__('Eliminar', true), array('controller' => 'choices', 'action' => 'delete', $choice['id'], $choice['question_id']), null, sprintf(__('¿Está seguro que desea eliminar la respuesta %s?', true), $choice['text'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>

	</table>
<?php endif; ?>

	<div class="actions">
				<?php echo  $this->Html->link(__('Agregar Respuesta', true), array('action' => 'add_choice', $question['Question']['id']),true);?>	
		</div>



</div>

</div>
<div class="actions">
	<h3><?php __('Acciones'); ?></h3>
	<ul>
		<li><?php echo $this->Html->link(__('Editar Pregunta', true), array('action' => 'edit', $question['Question']['id'])); ?> </li>
		<li><?php echo $this->Html->link(__('Eliminar Pregunta', true), array('action' => 'delete', $question['Question']['id']), null, sprintf(__('¿Está segura que desea eliminar la pregunta %s?', true), $question['Question']['text'])); ?> </li>
		<li><?php echo $this->Html->link(__('Listar Preguntas', true), array('action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('Nueva pregunta', true), array('action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('Listar Módulos', true), array('controller' => 'topics', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('Nuevo Módulo', true), array('controller' => 'topics', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('Listar Respuestas', true), array('controller' => 'choices', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('Nueva Respuesta', true), array('controller' => 'choices', 'action' => 'add')); ?> </li>
</div>
</div>

